var _ajax = function (url, submit, method) {
	var serverReturn = null;
	submit = submit || {};
	$.ajax({
		url:		url,
		data:		submit,
		type:		method,
		dataType:	'json',
		async:		false,
		cache:		false,
		complete:	function(xml) {},
		success:	function(str) {
			serverReturn = str
		}
	})
	return serverReturn;
}

var _get = function(url, submit) {
		return _ajax(url, submit, 'GET');
	}

var _post = function(url, submit) {
		return _ajax(url, submit, 'POST');
	}

var showSuccess = function(ele, disappear) {
	disappear = disappear || 1;
	var success = $(ele).after(' <span class="label label-success">成功</span>').next().hide();
	success.fadeIn('fast', function(){
		if (disappear) {
			setTimeout(function(){
				$(success).fadeOut('normal');
			}, 300)
		}
	})
	return true;
}

var showFailed = function(ele, disappear) {
	disappear = disappear || 0;
	var failed = $(ele).after(' <span class="label label-default">失败</span>').next().hide();
	failed.fadeIn('fast', function() {
		if (disappear) {
			setTimeout(function() {
				$(failed).fadeOut('normal');
			}, 300)
		}
	})
	return false;
}